package com.ynunicom.midplatform.sys.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * UserInfoService
 *
 * @author zf
 * @version 2018/5/2 14:22
 */
@Service
public class SysUserService {

    private final SysUserDao sysUserDao;

    @Autowired
    public SysUserService(SysUserDao sysUserDao) {
        this.sysUserDao = sysUserDao;
    }

    public SysUser findByLoginName(String loginName) {
        return sysUserDao.findByLoginName(loginName);
    }

    public List<SysUser> findAll() {
        return sysUserDao.findAllByIdNot(1L);
    }


    public void delete(SysUser sysUser) {
        sysUserDao.delete(sysUser);
    }

}
